// Copyright (c) 2024, cy080585@126.com and contributors
// For license information, please see license.txt

frappe.ui.form.on("Payment", {
    customer(frm){
        if (frm.doc.customer){
            frappe.call({
                method: "zy_packlist.zy_packlist.doctype.payment.payment.get_unpaid_amount",
                args:{
                    customer:frm.doc.customer,
                },
                callback(r){
                  
                    console.log(r.message);
                    frm.set_value("unpaid_amount", r.message)
                    
                }
                
            })

        }
        
    }
});
